﻿@model VehicleManagement.Models.Approval
@{
    ViewBag.Title = "Edit";
}

@Html.Partial("_PartviewDrivermanageNav")
<div class="content bc">
    <div class="content_link_warn f12">
        你当前的位置：审批申请记录&gt&gt &nbsp;&nbsp;查看申请记录&gt&gt &nbsp;&nbsp;查询审批信息
    </div>
    <div class="content_right fr" id="rightcontent">
        @using (Html.BeginForm())
        {
            @Html.ValidationSummary(true)
            <fieldset>
                @*<legend></legend>*@
                <div class="OutTitle">
                    <span>审批信息修改</span></div>
                <div class="Box">
                    <div class="SubBox1 mt5 ml15 mr15">
                    <div class="SubTitle">
                        申请基本信息</div>
                    <div class="SubBox-container">
                        <div class="text-wrap">
                            <div class="text-line">
                                <div class="withValidate">
                                    <span>@Html.LabelFor(model => model.apply.ApplicantName):</span>
                                    @Html.DisplayFor(model => model.apply.ApplicantName)
                                    <div class="validate">
                                    </div>
                                </div>
                                <div class="withValidate">
                                    <span>@Html.LabelFor(model => model.apply.CarType):</span>
                                    @Html.DisplayFor(model => model.apply.CarType)
                                    <div class="validate">
                                    </div>
                                </div>
                                <div class="withValidate">
                                    <span>@Html.LabelFor(model => model.apply.CarUse):</span>
                                    @Html.DisplayFor(model => model.apply.CarUse)
                                    <div class="validate">
                                    </div>
                                </div>
                            </div>
                            <div class="padding">
                            </div>
                            <div class="text-line">
                                <div class="withValidate">
                                    <span>@Html.LabelFor(model => model.apply.Beginning):</span>
                                    @Html.DisplayFor(model => model.apply.Beginning)
                                    <div class="validate">
                                    </div>
                                </div>
                                <div class="withValidate">
                                    <span class="spanType1">@Html.LabelFor(model => model.apply.Destination):</span>
                                    @Html.DisplayFor(model => model.apply.Destination)
                                </div>
                                <div class="withValidate">
                                    <span>@Html.LabelFor(model => model.apply.ApplyTime):</span>
                                    @String.Format("{0:g}", Model.apply.ApplyTime)
                                    <div class="validate">
                                    </div>
                                </div>
                                <div class="padding">
                                </div>
                            <div class="text-line">
                                    <span class="spanType1">@Html.LabelFor(model => model.apply.Remark):</span>
                                    @Html.DisplayFor(model => model.apply.Remark)
                                </div>
                            </div>
                            <div class="pt20"></div>
                        </div>
                    </div>
                    </div>
                    <div class="SubBox2 m15 mt10 mb5">
                                            <div class="SubTitle">
                            审批基本信息</div>
                        <div class="SubBox-container">
                            <div class="text-wrap">
                                <div class="text-line">
                                    @*<div class="withValidate">
                                        <span>@Html.LabelFor(model => model.ApplyState):</span>
                                        @Html.EditorFor(model => model.ApplyState)
                                        <div class="special-validate">
                                            @Html.ValidationMessageFor(model => model.ApplyState)
                                        </div>
                                    </div>*@
                                    @Html.HiddenFor(model => model.ApprovalID)
                                    @Html.HiddenFor(model => model.ApplyID)
                                    @Html.HiddenFor(model => model.ApplyState)
                                    <div class="withValidate">
                                        <span>@Html.LabelFor(model => model.CarNumber):</span>
                                        @Html.DropDownListFor(model => model.CarNumber, new SelectList(new[] { "车牌号" }, "车牌号"))
                                        <div class="validate">
                                            @Html.ValidationMessageFor(model => model.CarNumber)
                                        </div>
                                    </div>
                                    <div class="withValidate">
                                        <span>@Html.LabelFor(model => model.DriverName):</span>
                                        @Html.DropDownListFor(model => model.DriverName, new SelectList(new[] { "司机姓名" }, "司机姓名"))
                                        <div class="validate">
                                            @Html.ValidationMessageFor(model => model.DriverName)
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <div class="SubBox-container">
                            <div class="text-wrap ml5 mb5 mr5">
                                <div class="text-line">
                                    @*<div class="withValidate">
                                        <span>@Html.LabelFor(model => model.Priority):</span>
                                        @Html.EditorFor(model => model.Priority)
                                        <div class="validate">
                                            @Html.ValidationMessageFor(model => model.Priority)
                                        </div>
                                    </div>*@
                                     <div class="withValidate">
                                        <span>@Html.LabelFor(model => model.PriorityShow):</span>
                                        @Html.DropDownListFor(model => model.PriorityShow, new SelectList(new[] { " ", "一般", "较紧急", "十分紧急" }, Model.PriorityShow))
                                        <div class="validate">
                                            @Html.ValidationMessageFor(model => model.PriorityShow)
                                        </div>
                                    </div>
                                    <div class="withValidate">
                                        <span>@Html.LabelFor(model => model.Reason):</span>
                                         @Html.DropDownListFor(model => model.Reason, new SelectList(new[] { " ", "任务不可行", "暂时没有适合的车辆", "暂时没有适合的司机" }," "))
                                        <div class="validate">
                                            @Html.ValidationMessageFor(model => model.Reason)
                                        </div>
                                    </div>
                                    <div class="clear"></div>
                                </div>
                                <div class="text-line">
                                        <span class="spanType1">@Html.LabelFor(model => model.Remark):</span>
                                        @Html.TextAreaFor(model => model.Remark)
                                 </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="button-wrap">
                    <div class="submit-wrap">
                        <div class="divINsubmit saveEdit">
                            <input class="submit" type="submit" value="保存修改" /></div>
                    </div>
                    <div class="a-back mr15">
                        <div class="divINa-back">@Html.ActionLink("返回", "../Apply/Index")</div>
                    </div>
                </div>
            </fieldset>    
        }
    </div>
    @Html.Partial("_PartviewApprovalLeftbar")
    <div class="content_contract fl">
        <a href="javascript:void(0)" class="btn_contract w8h32" id="contract" title="收缩">
        </a><a href="javascript:void(0)" class="btn_expand w8h32" id="expand" title="展开">
        </a>
    </div>
    <div class="cb">
    </div>
</div>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<script type="text/javascript">
    $(function () {
        $.post("/Driver/GetDriverNameListByState", { state: 0 },
            function (data) {
                $("#DriverName").empty();
                $("#DriverName").append('<option>' + '</option>');
                if ('@Model.DriverName'.length != 0) {
                    $("#DriverName").append('<option>' + '@Model.DriverName' + '</option>');
                }
                $.each(data, function () {
                    $("#DriverName").append('<option>' + this + '</option>');
                });

                $("#DriverName").val('@Model.DriverName');
            });

        $.post("/CarInfo/GetCarsAvailable", { state: 0 },
            function (data) {
                $("#CarNumber").empty();
                if ('@Model.DriverName'.length != 0) {
                    $("#CarNumber").append('<option>' + '</option>');
                }
                $("#CarNumber").append('<option>' + '@Model.CarNumber' + '</option>');
                $.each(data, function () {
                    $("#CarNumber").append('<option>' + this + '</option>');
                });

                $("#CarNumber").val('@Model.CarNumber');
            });
    });
</script>